<%@ page pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/base/taglibs.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<link href="${ctx}/css/main.css" rel="stylesheet" type="text/css" />
	</head>
	<script type="text/javascript" src="${ctx}/js/My97DatePicker/WdatePicker.js"></script>
	<script language="javascript">
		function submitAction(actionName){
			document.exportForm.action = actionName ;
			document.exportForm.submit();
		}
		
		function init() {
			document.getElementById("infoCategory").value = '';
			document.getElementById("prodName").value = '';
			document.getElementById("prodType").value = '';
			document.getElementById("brand").value = '';
			document.getElementById("publishTimeFrom").value = '';
			document.getElementById("publishTimeTo").value = '';
		}
	</script>
	
	<body>
		<form method="post" action="" name="exportForm">
			<table border="0" cellspacing="1" cellpadding="3" align="center" width="100%">
				<tr>
					<td width="20%" class="td2"> 
						商品名称
					</td>
					<td width="30%" class="td2">
						<input type="text" name="prodName" size="32" value="${prodExport.prodName}">
					</td><td width="20%" class="td2"> 
						信息类别
					</td>
					<td width="30%" class="td2">
						<select name="infoCategory" style="width:200px">
							<option></option>
						    <c:if test="${prodExport.infoCategory == 1}"> 
				    			<option value="1" selected="selected">出售</option>
				    			<option value="2" >求购</option>
				    		</c:if>
				    		<c:if test="${prodExport.infoCategory == 2}">
				    			<option value="1" >出售</option>
				    			<option value="2" selected="selected">求购</option>
				   			</c:if>
				   			<c:if test="${prodExport.infoCategory != 2 && prodExport.infoCategory != 1}">
				    			<option value="1" >出售</option>
				    			<option value="2" >求购</option>
				   			</c:if>
						</select>	
					</td>
				</tr>
				<tr>
					<td width="20%" class="td2">
						商品种类
					</td>
					<td width="30%" class="td2">
						<select name="prodType" style="width:200px">
							<option></option>
						    <c:forEach var="prodType" items="${sessionScope.T_prodTypeList}">
						    	<c:if test="${prodExport.prodType == prodType.typeCode}">
						    		<option value="${prodType.typeCode}" selected="selected">${prodType.typeName}</option>
						    	</c:if>
						    	<c:if test="${prodExport.prodType != prodType.typeCode}">
						    		<option value="${prodType.typeCode}" >${prodType.typeName}</option>
						    	</c:if>
							</c:forEach>
					    </select>
					</td>
					<td width="20%" class="td2"> 
						商品品牌
					</td>
					<td width="30%" class="td2">
						<select name="brand" style="width:200px">
						    <option></option>
						    <c:forEach var="brand" items="${sessionScope.T_brandList}">
						    	<c:if test="${prodExport.brand == brand.typeCode}">
						    		<option value="${brand.typeCode}" selected="selected">${brand.typeName}</option>
						    	</c:if>
						    	<c:if test="${prodExport.brand != brand.typeCode}">
						    		<option value="${brand.typeCode}">${brand.typeName}</option>
						    	</c:if>
							</c:forEach>
					    </select>
					</td>
				</tr>
				<tr>
					<td width="20%" class="td2">
						发布时间（起）
					</td>
					<td width="30%" class="td2">
						<input size="28" readonly="readonly" id="publishTimeFrom" type="text" name="publishTimeFrom" value="${prodExport.publishTimeFrom}"/>
						<img onclick="WdatePicker({el:'publishTimeFrom'})" src="${ctx}/js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">
					</td>
					<td width="20%" class="td2">
						发布时间（止）
					</td>
					<td width="30%" class="td2">
						<input size="28" readonly="readonly" id="publishTimeTo" type="text" name="publishTimeTo" value="${prodExport.publishTimeTo}"/>
						<img onclick="WdatePicker({el:'publishTimeTo'})" src="${ctx}/js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">
					</td>
				</tr>
				<tr>
					<td class="td11" align="left" colspan="4">
						<input type="button" name="search" value="查询" onClick="submitAction('prodInfoExportSearch.ac');">
						&nbsp;&nbsp;<input type="button" name="export" value="导出Excel" onClick="submitAction('prodInfoToExcel.ac');">
						&nbsp;&nbsp;<input type="button" name="reset" value="重置" onClick="init()">
					</td>
				</tr>
			</table>
			<BR>
			<table border="0" cellspacing="1" cellpadding="3" align="center" width="100%">
				<tr>
					<td width="8%" class="td1" align="center">
						信息类别
					</td>
					<td width="10%" class="td1" align="center">
						商品名称
					</td>
					<td width="8%" class="td1" align="center">
						商品类别
					</td>
					<td width="6%" class="td1" align="center">
						价格
					</td>
					<td width="8%" class="td1" align="center">
						商品品牌
					</td>
					<td width="8%" class="td1" align="center">
						商品级别
					</td>
					<td width="10%" class="td1" align="center">
						是否热门产品
					</td>
					<td width="8%" class="td1" align="center">
						所有者
					</td>
					<td width="8%" class="td1" align="center">
						数量
					</td>
					<td width="6%" class="td1" align="center">
						单位
					</td>
					<td width="8%" class="td1" align="center">
						发布日期
					</td>
					<td width="8%" class="td1" align="center">
						截至日期
					</td>
				</tr>
				<c:forEach var="prodInfo" items="${prodExportList}">
					<tr>
						<td class="td2" align="center">
							${prodInfo.infoCategory}
						</td>
						<td class="td2">
							${prodInfo.prodName}
						</td>
						<td class="td2">
							${prodInfo.prodType}
						</td>
						<td class="td2" align="right">
							${prodInfo.price}
						</td>
						<td class="td2" align="center">
							${prodInfo.brand}
						</td>
						<td class="td2" align="center">
							${prodInfo.prodLevel}
						</td>
						<td class="td2" align="center">
							${prodInfo.hotFlag}
						</td>
						<td class="td2" align="center">
							${prodInfo.prodOwner}
						</td>
						<td class="td2" align="center">
							${prodInfo.amount}
						</td>
						<td class="td2" align="center">
							${prodInfo.unit}
						</td>
						<td class="td2" align="center">
							${prodInfo.publishTime}
						</td>
						<td class="td2" align="center">
							${prodInfo.endDate}
						</td>
					</tr>
				</c:forEach>
			</table>
		</form>
	</body>
</html>